-- 最稳定的 AcceptTrade 参数抓取器 v1.0
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Trade = ReplicatedStorage:WaitForChild("Trade")
local Players = game:GetService("Players")

-- 保护原始元方法
local mt = getrawmetatable(game)
setreadonly(mt, false)

local oldNamecall = mt.__namecall

mt.__namecall = newcclosure(function(self, ...)
    local method = getnamecallmethod()
    local args = {...}

    -- 捕获 AcceptTrade.FireServer 调用
    if method == "FireServer" and tostring(self) == "AcceptTrade" then
        warn("======【交易请求捕获 - AcceptTrade】======")
        for i, v in ipairs(args) do
            print("参数[" .. i .. "]:", typeof(v), v)
            if typeof(v) == "table" then
                for j, item in ipairs(v) do
                    if typeof(item) == "table" then
                        print(string.format("  物品[%d]: 名称=%s 数量=%s 类型=%s", j, tostring(item[1]), tostring(item[2]), tostring(item[3])))
                    else
                        print(string.format("  项[%d]: %s", j, tostring(item)))
                    end
                end
            end
        end
        print("========================================")
    end

    return oldNamecall(self, ...)
end)

print("✅ AcceptTrade 参数拦截器已启动，请进行一次交易以抓取参数")
